﻿<Controls:SinacorWindow  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                         xmlns:Custom="http://schemas.xceed.com/wpf/xaml/datagrid"
                         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                         mc:Ignorable="d"
                         xmlns:Model="clr-namespace:Sinacor.UI.Bovespa.Corretagem.Model;assembly=Sinacor.UI.Bovespa.Corretagem.Model"
                         xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
                         xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
                         WindowStartupLocation="CenterScreen" 
                         WindowState="Maximized" 
                         Title="{DynamicResource Bovespa.Corretagem.Label.TabelaPoliticaCorretagem}"
                         x:Class="Sinacor.UI.Bovespa.Corretagem.View.SmartClient.TabelaPoliticaCorretagem" 
                         ModulePlus="False"
                         ModuleId="ORD">

    <Controls:SinacorTabControl x:Name="TabMain" 
                                IsSynchronizedWithCurrentItem="True">
        <Controls:SinacorTabItem x:Name="TbiCorretagem"
                                 Header="{DynamicResource Bovespa.Corretagem.Label.Tabelas}" 
								 IsTabStop="False">
            <Grid>
                <Controls:SinacorExpanderContainer HorizontalAlignment="Stretch" 
											       VerticalAlignment="Stretch" 
											       Grid.Row="0">
                    <Controls:SinacorExpanderContainer.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*" />
                    </Controls:SinacorExpanderContainer.RowDefinitions>

                    <Controls:SinacorExpander x:Name="ExpPesquisa"
                                              HorizontalAlignment="Stretch" 
											  VerticalAlignment="Stretch" 
											  Width="Auto" 
											  Header="{DynamicResource Bovespa.Corretagem.Label.Pesquisa}" 
											  IsExpanded="True" 
											  Grid.Row="0">
                        <Grid>
                            <Controls:SinacorLabel x:Name="LblCodigoTabela"
                                                   HorizontalAlignment="Left"
												   VerticalAlignment="Top" 
												   Content="{DynamicResource Bovespa.Corretagem.Label.CodigoTabela}" 
												   Width="100"/>
                            <Controls:SinacorInt16TextBox x:Name="TxtCodigoTabela"
                                                          HorizontalAlignment="Left" 
														  VerticalAlignment="Top" 
														  TextWrapping="NoWrap" 
														  Margin="104,0,0,0" 
														  Width="60" 
														  TabIndex="1" 
														  Integers="4"
														  IsFormated="False"                                                          
                                                          Value="{Binding FiltroTabela.Codigo, UpdateSourceTrigger=PropertyChanged}"/>
                            <Controls:SinacorLabel x:Name="LblDescricao"
                                                   HorizontalAlignment="Left" 
												   Content="{DynamicResource Bovespa.Corretagem.Label.Descricao}" 
												   Margin="168,0,0,0" 
												   Width="80"/>
                            <Controls:SinacorTextBox x:Name="TxtDescricao"
                                                     HorizontalAlignment="Left" 
													 VerticalAlignment="Top"
													 TextWrapping="NoWrap" 
													 Margin="252,0,0,0" 
													 Width="518" 
                                                     MaxLength="20"
													 TabIndex="2"
                                                     Text="{Binding FiltroTabela.Descricao, UpdateSourceTrigger=PropertyChanged}"/>
                            <Controls:SinacorGroupBox x:Name="GrpAplicacao" HorizontalAlignment="Left" 
													  VerticalAlignment="Top" 
													  Header="{DynamicResource Bovespa.Corretagem.Label.Aplicacao}" 
													  Height="60" 
													  Margin="0,25,0,0" 
													  Width="520">
                                <Grid>
                                    <Controls:SinacorRadioButton x:Name="RdbSomaValoresOperadorPesquisa"
                                                                 HorizontalAlignment="Left" 
																 VerticalAlignment="Top" 
																 Content="{DynamicResource Bovespa.Corretagem.Label.SomaValoresOperador}" 
																 Width="190" 
																 TabIndex="3" 
																 GroupName="aplicacaoPesquisa"
                                                                 Checked="RdbSomaValoresOperadorPesquisa_Checked"/>
                                    <Controls:SinacorRadioButton x:Name="RdbAssumeMaiorValorPesquisa"
                                                                 HorizontalAlignment="Left" 
																 VerticalAlignment="Top" 
																 Content="{DynamicResource Bovespa.Corretagem.Label.AssumeMaiorValor}" 
																 Margin="194,0,0,0" 
																 Width="150" 
																 TabIndex="4" 
																 GroupName="aplicacaoPesquisa"
                                                                 Checked="RdbAssumeMaiorValorPesquisa_Checked"/>
                                    <Controls:SinacorRadioButton x:Name="RdbAssumeMenorValorPesquisa"
                                                                 HorizontalAlignment="Left" 
																 VerticalAlignment="Top" 
																 Content="{DynamicResource Bovespa.Corretagem.Label.AssumeMenorValor}" 
																 Width="155" 
																 Margin="348,0,0,0" 
																 TabIndex="5" 
																 GroupName="aplicacaoPesquisa"
                                                                 Checked="RdbAssumeMenorValorPesquisa_Checked"/>
                                </Grid>
                            </Controls:SinacorGroupBox>
                            <Controls:SinacorGroupBox x:Name="GrdIndDescDif"
                                                      HorizontalAlignment="Left" 
													  VerticalAlignment="Top" 
													  Header="{DynamicResource Bovespa.Corretagem.Label.IndDescDif}" 
													  Height="60" 
													  Margin="524,25,0,0" 
													  Width="246">
                                <Grid>
                                    <Controls:SinacorRadioButton x:Name="RdbSimPesquisa"
                                                                 HorizontalAlignment="Left" 
																 VerticalAlignment="Top" 
																 Content="{DynamicResource Bovespa.Corretagem.Label.Sim}" 
																 Width="90" 
																 TabIndex="6" 
																 GroupName="inddescdifPesquisa"
                                                                 Checked="RdbSimPesquisa_Checked"/>
                                    <Controls:SinacorRadioButton x:Name="RdbNaoPesquisa"
                                                                 HorizontalAlignment="Left" 
																 VerticalAlignment="Top" 
																 Content="{DynamicResource Bovespa.Corretagem.Label.Nao}" 
																 Margin="94,0,0,0" 
																 Width="90" 
																 TabIndex="7" 
																 GroupName="inddescdifPesquisa"
                                                                 Checked="RdbNaoPesquisa_Checked"/>
                                </Grid>
                            </Controls:SinacorGroupBox>
                            <Controls:SinacorButton x:Name="BtnPesquisar" HorizontalAlignment="Left" 
													VerticalAlignment="Top" 
													Content="{DynamicResource Bovespa.Corretagem.Label.Pesquisar}" 
													Margin="774,35,0,0" 
													Width="110" 
													TabIndex="8" 
													IsDefault="True"
                                                    Click="BtnPesquisar_Click"
                                                    CausesValidation="True"/>
                            <Controls:SinacorButton x:Name="BtnNovaPesquisa"
                                                    HorizontalAlignment="Left" 
													VerticalAlignment="Top" 
													Content="{DynamicResource Bovespa.Corretagem.Label.NovaPesquisa}" 
													Margin="774,61,0,0" 
													Width="110" 
													TabIndex="9"
                                                    Click="BtnNovaPesquisa_Click"/>
                        </Grid>
                    </Controls:SinacorExpander>
                    <Controls:SinacorExpander HorizontalAlignment="Stretch" 
											  VerticalAlignment="Stretch" 
											  Header="{DynamicResource Bovespa.Corretagem.Label.Tabelas}" 
											  Grid.Row="1" 
											  Margin="0,4,0,0" 
											  AllowExpand="False" 
											  IsExpanded="True">
                        <Grid>
                            <Controls:SinacorDataGrid x:Name="DtgTabelaCorretagem"
                                                      AllowPanelInsert="True"
                                                      AllowPanelUpdate="True"
                                                      AllowDelete="True"
                                                      InsertBegun="DtgTabelaCorretagem_InsertBegun"
                                                      EndingInsert="DtgTabelaCorretagem_EndingInsert"
                                                      CancelingInsert="DtgTabelaCorretagem_CancelingInsert"
                                                      UpdateBegun="DtgTabelaCorretagem_UpdateBegun"
                                                      EndingUpdate="DtgTabelaCorretagem_EndingUpdate"
                                                      CancelingUpdate="DtgTabelaCorretagem_CancelingUpdate"
                                                      Deleting="DtgTabelaCorretagem_Deleting"
                                                      CurrentCellChanged="DtgTabelaCorretagem_CurrentCellChanged"
                                                      HorizontalAlignment="Stretch" 		
                      		                          VerticalAlignment="Stretch" 		
                            	                      IsSynchronizedWithCurrentItem="True"
                                      	              RowEditMode="EditPanel"	
                                        	          Margin="0,0,0,0"
                                                      ItemsSource="{Binding ListaTabelasCorretagem}"
                                                      PanelInsertTemplate="{Binding PanelUpdateTemplate, RelativeSource={RelativeSource Self}}">
                                <Controls:SinacorDataGrid.ContextMenuTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <Controls:SinacorContextMenuItem x:Name="menuDuplicar" Header="{DynamicResource Bovespa.Corretagem.Label.Duplicar}" Loaded="menuDuplicar_Loaded" Click="menuDuplicar_Click" />
                                            <Controls:SinacorContextMenuItem x:Name="menuConsultarPolitica" Header="{DynamicResource Bovespa.Corretagem.Label.ConsultarPoliticasRelacionadas}" Loaded="menuConsultarPolitica_Loaded"  Click="menuConsultarPolitica_Click" />
                                        </StackPanel>
                                    </DataTemplate>
                                </Controls:SinacorDataGrid.ContextMenuTemplate>
                                <Controls:SinacorDataGrid.PanelUpdateTemplate>
                                    <DataTemplate>
                                        <Controls:SinacorExpanderContainer HorizontalAlignment="Stretch"
                                                                           VerticalAlignment="Stretch" 
															               >
                                            <Controls:SinacorExpanderContainer.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="30" />
                                            </Controls:SinacorExpanderContainer.RowDefinitions>

                                            <!-- INÍCIO DO GRID SUPERIOR -->

                                            <Grid Grid.Row="0">
                                                <Controls:SinacorLabel x:Name="LblCodigoTabela"
                                                                       HorizontalAlignment="Left" 
												                       VerticalAlignment="Top" 
												                       Content="{DynamicResource Bovespa.Corretagem.Label.CodigoTabela}" 
												                       Width="100"/>
                                                <Controls:SinacorInt16TextBox x:Name="TxtCodigoTabela"
                                                                              HorizontalAlignment="Left" 
															                  VerticalAlignment="Top" 
															                  TextWrapping="NoWrap" 
															                  Margin="104,0,0,0" 
															                  Width="60" 
															                  TabIndex="1" 
															                  Integers="4"
															                  IsFormated="False"
                                                                              IsRequired="True"
                                                                              RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.CodigoTabelaObrigatorio"
                                                                              Value="{Binding Path=Codigo}"/>
                                                <Controls:SinacorLabel x:Name="LblDescricao"
                                                                       HorizontalAlignment="Left" 
													                   Content="{DynamicResource Bovespa.Corretagem.Label.Descricao}" 
													                   Margin="168,0,0,0" 
													                   Width="80"/>
                                                <Controls:SinacorTextBox x:Name="TxtDescricao"
                                                                         HorizontalAlignment="Left" 
														                 VerticalAlignment="Top" 
														                 TextWrapping="NoWrap" 
														                 Margin="252,0,0,0" 
														                 Width="518" 
                                                                         MaxLength="20"
														                 TabIndex="2"
                                                                         IsRequired="True"
                                                                         RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.DescricaoTabelaObrigatorio"
                                                                         Text="{Binding Path=Descricao}"/>
                                                <Controls:SinacorGroupBox x:Name="GrpValoresTipoBaseCalculo"
                                                                          HorizontalAlignment="Left" 
														                  VerticalAlignment="Top" 
														                  Header="{DynamicResource Bovespa.Corretagem.Label.ValoresTipoBaseCalculo}" 
														                  Height="50" 
														                  Margin="0,25,0,0" 
														                  Width="450">
                                                    <Grid>
                                                        <Controls:SinacorLabel x:Name="LblMinimo"
                                                                               HorizontalAlignment="Left" 
															                   VerticalAlignment="Top" 
															                   Content="{DynamicResource Bovespa.Corretagem.Label.Minimo}" 
															                   Width="70"/>
                                                        <Controls:SinacorDecimalTextBox x:Name="TxtMinimo"
                                                                                        HorizontalAlignment="Left" 
																		                VerticalAlignment="Top" 
																		                TextWrapping="NoWrap" 
																		                Margin="74,0,0,0" 
																		                Width="140" 
																		                TabIndex="3" 
																		                Integers="13" 
																		                Decimals="2"
                                                                                        IsFormated="True"                                                                                        
                                                                                        Value="{Binding Path=ValorMinimo}"/>
                                                        <Controls:SinacorLabel x:Name="LblMaximo"
                                                                               HorizontalAlignment="Left" 
															                   Margin="218,0,0,0" 
															                   VerticalAlignment="Top" 
															                   Content="{DynamicResource Bovespa.Corretagem.Label.Maximo}" 
															                   Width="70"/>
                                                        <Controls:SinacorDecimalTextBox x:Name="TxtMaximo"
                                                                                        HorizontalAlignment="Left" 
																		                VerticalAlignment="Top" 
																		                TextWrapping="NoWrap" 
																		                Margin="292,0,0,0" 
																		                Width="140" 
																		                TabIndex="4" 
																		                Integers="13" 
																		                Decimals="2"
                                                                                        IsFormated="True"
                                                                                        Value="{Binding Path=ValorMaximo}"/>
                                                    </Grid>
                                                </Controls:SinacorGroupBox>
                                                <Controls:SinacorGroupBox x:Name="GrpIndDescDif"
                                                                          HorizontalAlignment="Left" 
														                  VerticalAlignment="Top" 
														                  Header="{DynamicResource Bovespa.Corretagem.Label.IndDescDif}" 
														                  Height="50" 
														                  Margin="454,25,0,0" 
														                  Width="185">
                                                    <Grid>
                                                        <Controls:SinacorRadioButton x:Name="RdbSim"
                                                                                     HorizontalAlignment="Left" 
																	                 VerticalAlignment="Top" 
																	                 Content="{DynamicResource Bovespa.Corretagem.Label.Sim}" 
																	                 Width="60" 
																	                 TabIndex="5" 
																	                 GroupName="inddescdif"
                                                                                     Checked="RdbSim_Checked"/>
                                                        <Controls:SinacorRadioButton x:Name="RdbNao"
                                                                                     HorizontalAlignment="Left" 
																	                 VerticalAlignment="Top" 
																	                 Content="{DynamicResource Bovespa.Corretagem.Label.Nao}" 
																	                 Margin="94,0,0,0" 
																	                 Width="60" 
																	                 TabIndex="6" 
																	                 GroupName="inddescdif" 
																	                 IsChecked="True"
                                                                                     Checked="RdbNao_Checked"/>
                                                    </Grid>
                                                </Controls:SinacorGroupBox>

                                            </Grid>

                                            <!-- FINAL DO GRID SUPERIOR -->
                                            <!-- INÍCIO DO GRID DO MEIO -->

                                            <Grid Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="350" />
                                                    <ColumnDefinition Width="*" />
                                                </Grid.ColumnDefinitions>

                                                <Controls:SinacorExpander x:Name="ExpDescontosDiferenciados"
                                                                      HorizontalAlignment="Stretch" 
														              VerticalAlignment="Stretch" 
														              Header="{DynamicResource Bovespa.Corretagem.Label.DescontosDiferenciados}" 
														              Grid.Column="0" 
														              Margin="0,4,0,0" 
														              AllowExpand="False"
														              IsExpanded="True"
                                                                      Height="285"
                                                                      Visibility="Hidden">
                                                    <Grid>
                                                        <Controls:SinacorDataGrid x:Name="DtgDescontoDiferenciado"
                                                                              HorizontalAlignment="Stretch" 		
			    							                                  VerticalAlignment="Stretch" 		
			    							                                  IsSynchronizedWithCurrentItem="True"
                                                                              NewItemType="{x:Type Model:DescontoDiferenciado}"
                                                                              IsEnabled="False"
                                                                              AllowDelete="False"
                                                                              AllowSave="False"
                                                                              AllowSaveAll="False"
                                                                              UpdateBegun="DtgDescontoDiferenciado_UpdateBegun"
                                                                              CancelingUpdate="DtgDescontoDiferenciado_CancelingUpdate"
                                                                              EndingUpdate="DtgDescontoDiferenciado_EndingUpdate"
                                                                              CurrentCellChanged="DtgDescontoDiferenciado_CurrentCellChanged"
                                                                              ItemsSource="{Binding Path=Descontos}">
                                                            <Controls:SinacorDataGrid.Columns>
                                                                <Controls:Column Name="Uso"
			    												             Title="Bovespa.Corretagem.Label.Uso"
                                                                             AllowInsert="False"
                                                                             AllowUpdate="True"
                                                                             DisplayMemberPath="Utiliza">
                                                                    <Controls:Column.CellUpdateTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorCheckBox x:Name="ChkUso" IsChecked="{Binding Utiliza}" Click="ChkUso_Click" />
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellUpdateTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="TipoDesc"
			    												             Title="Bovespa.Corretagem.Label.TipoDesconto"
                                                                             MaxLength="20"
                                                                             IsRequired="True"
                                                                             AllowInsert="False"
                                                                             AllowUpdate="False"
                                                                             DisplayMemberPath="TipoDesconto.Descricao">
                                                                </Controls:Column>

                                                                <Controls:Column Name="Percentual"
			    												             Title="Bovespa.Corretagem.Label.Percentual"
                                                                             HorizontalCellAlignment="Right"
                                                                             AllowInsert="False"
                                                                             AllowUpdate="True"
                                                                             DisplayMemberPath="Percentual">
                                                                    <Controls:Column.CellUpdateTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorDecimalTextBox x:Name="TxtPercentual" IsRequired="False" RequiredErrorMessage="Bovespa.Corretagem.Message.PercentualObrigatorio" Integers="4" Decimals="8" Value="{Binding Percentual}" />
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellUpdateTemplate>
                                                                </Controls:Column>

                                                            </Controls:SinacorDataGrid.Columns>
                                                        </Controls:SinacorDataGrid>

                                                    </Grid>
                                                </Controls:SinacorExpander>
                                                <Controls:SinacorExpander x:Name="ExpFaixasAplicacao"
                                                                      HorizontalAlignment="Stretch" 
														              VerticalAlignment="Stretch" 
														              Header="{DynamicResource Bovespa.Corretagem.Label.FaixasAplicacao}" 
														              Margin="0,4,0,0" 
														              AllowExpand="False" 
														              IsExpanded="True" 
														              Grid.Column="0"
                                                                      Grid.ColumnSpan="2"    
                                                                      Height="285"
                                                                      Width="Auto">
                                                    <Grid Name="GrdFaixasAplicacao" HorizontalAlignment="Left" VerticalAlignment="Top" Height="245" Width="Auto">
                                                        <Controls:SinacorGroupBox x:Name="GrpAplicacao"
                                                                              HorizontalAlignment="Stretch" 
																              VerticalAlignment="Top" 
																              Header="{DynamicResource Bovespa.Corretagem.Label.Aplicacao}" 
																              Height="50" 
                                                                              Width="Auto">
                                                            <Grid Width="Auto" Height="Auto">
                                                                <Controls:SinacorRadioButton x:Name="RdbSomaValoresOperador"
                                                                                         HorizontalAlignment="Left" 
																			             VerticalAlignment="Top" 
																			             Content="{DynamicResource Bovespa.Corretagem.Label.SomaValoresOperador}" 
																			             Width="170" 
																			             TabIndex="7" 
																			             GroupName="aplicacao"
                                                                                         Checked="RdbSomaValoresOperador_Checked"/>
                                                                <Controls:SinacorRadioButton x:Name="RdbAssumeMaiorValor"
                                                                                         HorizontalAlignment="Left" 
																			             VerticalAlignment="Top" 
																			             Content="{DynamicResource Bovespa.Corretagem.Label.AssumeMaiorValor}" 
																			             Margin="174,0,0,0" 
																			             Width="150" 
																			             TabIndex="8" 
																			             GroupName="aplicacao"
                                                                                         Checked="RdbAssumeMaiorValor_Checked"/>
                                                                <Controls:SinacorRadioButton x:Name="RdbAssumeMenorValor"
                                                                                         HorizontalAlignment="Left" 
																			             VerticalAlignment="Top" 
																			             Content="{DynamicResource Bovespa.Corretagem.Label.AssumeMenorValor}" 
																			             Width="155" 
																			             Margin="328,0,0,0" 
																			             TabIndex="9" 
																			             GroupName="aplicacao"
                                                                                         Checked="RdbAssumeMenorValor_Checked"/>
                                                            </Grid>
                                                        </Controls:SinacorGroupBox>
                                                        <Grid Name="GrdFaixaAplicacao" Height="Auto">
                                                            <Controls:SinacorDataGrid x:Name="DtgFaixaAplicacao"
                                                                              HorizontalAlignment="Stretch" 		
								    							              VerticalAlignment="Stretch" 		
								    							              IsSynchronizedWithCurrentItem="True"	
                                                                              AllowDelete="True"
                                                                              AllowSave="False"
                                                                              AllowSaveAll="False"
                                                                              Margin="0,55,0,0"
                                                                              InsertBegun="DtgFaixaAplicacao_InsertBegun"
                                                                              CancelingInsert="DtgFaixaAplicacao_CancelingInsert"
                                                                              EndingInsert="DtgFaixaAplicacao_EndingInsert"
                                                                              Deleting="DtgFaixaAplicacao_Deleting"
                                                                              CurrentCellChanged="DtgFaixaAplicacao_CurrentCellChanged"
                                                                              NewItemType="{x:Type Model:FaixaAplicacao}"
                                                                              ItemsSource="{Binding Path=Faixas}" >
                                                                <Controls:SinacorDataGrid.Columns>
                                                                    <Controls:Column Name="TipoAplic"
			    												             Title="Bovespa.Corretagem.Label.TipoAplicacao"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False"
                                                                             DisplayMemberPath="TipoAplicacao.IdentificadorBaseCalculo"
                                                                             AutoAdjustWidthToContent="False"
                                                                             Width="153"
                                                                             CellUpdateTemplate="{Binding CellInsertTemplate, RelativeSource={RelativeSource Self}}">
                                                                        <Controls:Column.CellTemplate>
                                                                            <DataTemplate>
                                                                                <StackPanel>
                                                                                    <Controls:SinacorLabel x:Name="LblTipoAplic" Content="{Binding ElementName=CmbTipoAplic_Aux, Path=Text}" />
                                                                                    <Controls:SinacorComboBox x:Name="CmbTipoAplic_Aux"
                                                                                                  ItemsSource="{Binding Path=Presenter.ListaTiposAplicacoesCorretagem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                                                  SelectedValue="{Binding Path=TipoAplicacao.IdentificadorBaseCalculo}" 
                                                                                                  DisplayMemberPath="Descricao" 
                                                                                                  SelectedValuePath="IdentificadorBaseCalculo" 
                                                                                                  Visibility="Hidden"/>
                                                                                </StackPanel>
                                                                            </DataTemplate>
                                                                        </Controls:Column.CellTemplate>
                                                                        <Controls:Column.CellInsertTemplate>
                                                                            <DataTemplate>
                                                                                <Controls:SinacorComboBox x:Name="CmbTipoAplic"
                                                                                                  IsRequired="True"
                                                                                                  RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.TipoAplicacaoObrigatoria"
                                                                                                  ItemsSource="{Binding Path=Presenter.ListaTiposAplicacoesCorretagem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                                                  DisplayMemberPath="Descricao"
                                                                                                  SelectedValuePath="IdentificadorBaseCalculo"
                                                                                                  SelectedItem="{Binding Path=TipoAplicacao}"
                                                                                                  SelectionChanged="CmbTipoAplic_SelectionChanged"/>
                                                                            </DataTemplate>
                                                                        </Controls:Column.CellInsertTemplate>
                                                                    </Controls:Column>
                                                                    <Controls:Column Name="PorcAliquota"
			    												             Title="Bovespa.Corretagem.Label.Aliquota"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False"
                                                                             DisplayMemberPath="Aliquota"
                                                                             AutoAdjustWidthToContent="False"
                                                                             Width="76"
                                                                             HorizontalCellAlignment="Right">
                                                                        <Controls:Column.CellInsertTemplate>
                                                                            <DataTemplate>
                                                                                <Controls:SinacorDecimalTextBox x:Name="TxtPorcAliquota" IsRequired="True" RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.AliquotaNaoInformada" Integers="3" Decimals="4" Value="{Binding Aliquota}" />
                                                                            </DataTemplate>
                                                                        </Controls:Column.CellInsertTemplate>
                                                                    </Controls:Column>

                                                                    <Controls:Column Name="QtdVlInicial"
			    										     	             Title="Bovespa.Corretagem.Label.QtdVlInicial"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False"
                                                                             DisplayMemberPath="ValorQuantidadeInicial"
                                                                             AutoAdjustWidthToContent="False"
                                                                             Width="106"
                                                                             HorizontalCellAlignment="Right"
                                                                                 StringFormat="N2">
                                                                        <Controls:Column.CellInsertTemplate>
                                                                            <DataTemplate>
                                                                                <Controls:SinacorDecimalTextBox x:Name="TxtQtdVlInicial" IsRequired="True" RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.QuantidadeInicialObrigatoria" Integers="13" Decimals="2" Value="{Binding ValorQuantidadeInicial}" />
                                                                            </DataTemplate>
                                                                        </Controls:Column.CellInsertTemplate>
                                                                    </Controls:Column>

                                                                    <Controls:Column Name="QtdVlFinal"
			    												             Title="Bovespa.Corretagem.Label.QtdVlFinal"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False"                                                                             
                                                                             DisplayMemberPath="ValorQuantidadeFinal"
                                                                             AutoAdjustWidthToContent="False"
                                                                             Width="100"
                                                                             HorizontalCellAlignment="Right"
                                                                                 StringFormat="N2">
                                                                        <Controls:Column.CellInsertTemplate>
                                                                            <DataTemplate>
                                                                                <Controls:SinacorDecimalTextBox x:Name="TxtQtdVlFinal" IsRequired="True" RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.QuantidadeFinalObrigatoria" Integers="13" Decimals="2" Value="{Binding ValorQuantidadeFinal}" />
                                                                            </DataTemplate>
                                                                        </Controls:Column.CellInsertTemplate>
                                                                    </Controls:Column>

                                                                    <Controls:Column Name="Valor"
			    												             Title="Bovespa.Corretagem.Label.Valor"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False"
                                                                             DisplayMemberPath="Valor"
                                                                             AutoAdjustWidthToContent="False"
                                                                             Width="53"
                                                                             HorizontalCellAlignment="Right"
                                                                                 StringFormat="N2">
                                                                        <Controls:Column.CellInsertTemplate>
                                                                            <DataTemplate>
                                                                                <Controls:SinacorDecimalTextBox x:Name="TxtValor" IsRequired="True" RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.ValorNaoInformado" Integers="13" Decimals="2" Value="{Binding Valor}" />
                                                                            </DataTemplate>
                                                                        </Controls:Column.CellInsertTemplate>
                                                                    </Controls:Column>

                                                                </Controls:SinacorDataGrid.Columns>
                                                            </Controls:SinacorDataGrid>
                                                        </Grid>
                                                    </Grid>
                                                </Controls:SinacorExpander>
                                            </Grid>

                                            <!-- FIM DO GRID DO MEIO -->
                                            <!-- INICIO DO GRID EMBAIXO -->

                                            <Grid Grid.Row="2">
                                                <Controls:SinacorButton x:Name="BtnSalvar"
                                                                        HorizontalAlignment="Right" 
															            VerticalAlignment="Bottom" 
															            Content="{DynamicResource Bovespa.Corretagem.Label.Salvar}" 
															            Margin="0,0,89,0" 
															            Width="85" 
															            TabIndex="10" 
                                                                        Click="BtnSalvar_Click"
                                                                        CausesValidation="True"/>
                                                <Controls:SinacorButton x:Name="BtnCancelar"
                                                                        HorizontalAlignment="Right" 
															            VerticalAlignment="Bottom" 
															            Content="{DynamicResource Bovespa.Corretagem.Label.Cancelar}" 
															            Width="85" 
															            TabIndex="11"
                                                                        Click="BtnCancelar_Click"
                                                                        CausesValidation="False"/>
                                            </Grid>
                                            <!-- FINAL DO GRID EMBAIXO -->
                                        </Controls:SinacorExpanderContainer>
                                    </DataTemplate>
                                </Controls:SinacorDataGrid.PanelUpdateTemplate>

                                <Controls:SinacorDataGrid.Columns>

                                    <Controls:Column Name="Codigo"
                                                     Title="Bovespa.Corretagem.Label.Codigo"
                                                     HorizontalCellAlignment="Right"
                                                     DisplayMemberPath="Codigo"/>

                                    <Controls:Column Name="Descricao"
                                                     Title="Bovespa.Corretagem.Label.Descricao"
                                                     DisplayMemberPath="Descricao"/>

                                    <Controls:Column Name="Aplicacao"
                                                     Title="Bovespa.Corretagem.Label.Aplicacao"
                                                     DisplayMemberPath="ModoAplicacao"/>

                                    <Controls:Column Name="IndDescDif"
                                                     Title="Bovespa.Corretagem.Label.IndDescDif"
                                                     DisplayMemberPath="IndicadorDescontoDiferenciado"/>

                                    <Controls:Column Name="ValorMaximo"
                                                     Title="Bovespa.Corretagem.Label.ValorMaximo"
                                                     HorizontalCellAlignment="Right"
                                                     DisplayMemberPath="ValorMaximo"
                                                     StringFormat="#,###,###,###,##0.00"/>

                                    <Controls:Column Name="ValorMinimo"
                                                     Title="Bovespa.Corretagem.Label.ValorMinimo"
                                                     HorizontalCellAlignment="Right"
                                                     DisplayMemberPath="ValorMinimo"
                                                     StringFormat="#,###,###,###,##0.00"/>

                                </Controls:SinacorDataGrid.Columns>
                            </Controls:SinacorDataGrid>

                        </Grid>
                    </Controls:SinacorExpander>
                </Controls:SinacorExpanderContainer>
            </Grid>
        </Controls:SinacorTabItem>
        <Controls:SinacorTabItem x:Name="TbiPoliticas"
                                 Header="{DynamicResource Bovespa.Corretagem.Label.Politicas}" 
								 IsTabStop="False">
            <Grid>
                <Controls:SinacorExpanderContainer HorizontalAlignment="Stretch" 
											   VerticalAlignment="Stretch" 
											   Grid.Row="0">
                    <Controls:SinacorExpanderContainer.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*" />
                    </Controls:SinacorExpanderContainer.RowDefinitions>

                    <Controls:SinacorExpander x:Name="ExpPesquisaPoliticas"
                                              HorizontalAlignment="Stretch" 
											  VerticalAlignment="Stretch" 
											  Width="Auto" 
											  Header="{DynamicResource Bovespa.Corretagem.Label.Pesquisa}" 
											  IsExpanded="True" 
											  Grid.Row="0">
                        <Grid>
                            <Controls:SinacorLabel x:Name="LblCodigoPolitica"
                                                   HorizontalAlignment="Left" 
												   VerticalAlignment="Top" 
												   Content="{DynamicResource Bovespa.Corretagem.Label.CodigoPolitica}" 
												   Width="112"/>
                            <Controls:SinacorInt16TextBox x:Name="TxtCodigoPolitica"
                                                          HorizontalAlignment="Left" 
														  VerticalAlignment="Top"
														  Margin="116,0,0,0" 
														  Width="60" 
														  Integers="4" 
														  TabIndex="1"
														  IsFormated="False"
                                                          Value="{Binding FiltroPoliticas.Codigo, UpdateSourceTrigger=PropertyChanged}"/>
                            <Controls:SinacorLabel x:Name="LblDescricaoPolitica"
                                                   HorizontalAlignment="Left" 
												   Content="{DynamicResource Bovespa.Corretagem.Label.Descricao}" 
												   Margin="180,0,0,0" 
												   Width="80"/>
                            <Controls:SinacorTextBox x:Name="TxtDescricaoPolitica"
                                                     HorizontalAlignment="Left" 
													 VerticalAlignment="Top" 
													 TextWrapping="NoWrap" 
													 Margin="260,0,0,0" 
													 Width="230" 
													 TabIndex="2"
                                                     MaxLength="20"
                                                     Text="{Binding FiltroPoliticas.Descricao}"/>
                            <Controls:SinacorLabel x:Name="LblDataInicialPolitica"
                                                   Margin="495,0,0,0" 
												   VerticalAlignment="Top" 
												   Content="{DynamicResource Bovespa.Corretagem.Label.DataInicial}" 
												   Width="92" 
												   HorizontalAlignment="Left"/>
                            <Controls:SinacorDatePicker x:Name="DtpDataInicialPolitica" VerticalAlignment="Top" 
														Margin="591,0,0,0" 
														HorizontalAlignment="Left" 
														TabIndex="3"
                                                        Value="{Binding FiltroPoliticas.DataInicial}"/>
                            <Controls:SinacorLabel x:Name="LblDataFinalPolitica"
                                                   Content="{DynamicResource Bovespa.Corretagem.Label.DataFinal}" 
												   Margin="700,0,0,0" 
												   Width="80" 
												   HorizontalAlignment="Left"/>
                            <Controls:SinacorDatePicker x:Name="DtpDataFinalPolitica"
                                                        VerticalAlignment="Top" 
														Margin="784,0,0,0" 
														HorizontalAlignment="Left" 
														TabIndex="4"
                                                        Value="{Binding FiltroPoliticas.DataFinal}"/>
                            <Controls:SinacorLabel x:Name="LblAplicacaoPolitica"
                                                   HorizontalAlignment="Left" 
												   Margin="0,25,0,0" 
												   VerticalAlignment="Top" 
												   Content="{DynamicResource Bovespa.Corretagem.Label.Aplicacao}" 
												   Width="112"/>
                            <Controls:SinacorComboBox x:Name="CmbAplicacaoPolitica"
                                                      HorizontalAlignment="Left" 
													  VerticalAlignment="Top" 
													  Margin="116,25,0,0" 
													  Width="230" 
													  TabIndex="5"
                                                      ItemsSource="{Binding ListaTiposAplicacoesPoliticas}"
                                                      DisplayMemberPath="Descricao"
                                                      SelectedValuePath="Codigo"
                                                      SelectedItem="{Binding FiltroPoliticas.TipoAplicacao}"/>
                            <Controls:SinacorLabel x:Name="LblTabelaPadraoPolitica"
                                                   HorizontalAlignment="Left" 
												   Content="{DynamicResource Bovespa.Corretagem.Label.TabelaPadrao}" 
												   Margin="350,25,0,0" 
												   Width="110"/>
                            <Controls:SinacorComboBox x:Name="CmbTabelaPadraoPolitica"
                                                      HorizontalAlignment="Left" 
													  VerticalAlignment="Top" 
													  Margin="464,25,0,0" 
													  Width="230" 
													  TabIndex="6"
                                                      ItemsSource="{Binding ListaComboTabelasCorretagem}"
                                                      DisplayMemberPath="Descricao"
                                                      SelectedValuePath="Codigo"
                                                      SelectedItem="{Binding FiltroPoliticas.TabelaPadrao}"/>
                            <Controls:SinacorButton x:Name="BtnPesquisarPolitica"
                                                    HorizontalAlignment="Left" 
													VerticalAlignment="Top" 
													Content="{DynamicResource Bovespa.Corretagem.Label.Pesquisar}" 
													Margin="697,25,0,0" 
													Width="85" 
													TabIndex="8" 
													IsDefault="True"
                                                    Click="BtnPesquisarPolitica_Click"
                                                    CausesValidation="True"/>
                            <Controls:SinacorButton x:Name="BtnNovaPesquisaPolitica"
                                                    HorizontalAlignment="Left" 
													VerticalAlignment="Top" 
													Content="{DynamicResource Bovespa.Corretagem.Label.NovaPesquisa}" 
													Margin="786,25,0,0" 
													Width="105" 
													TabIndex="9"
                                                    Click="BtnNovaPesquisaPolitica_Click"/>
                        </Grid>
                    </Controls:SinacorExpander>
                    <Controls:SinacorExpander HorizontalAlignment="Stretch" 
											  VerticalAlignment="Stretch" 
											  Header="{DynamicResource Bovespa.Corretagem.Label.Politicas}" 
											  Grid.Row="1" 
											  Margin="0,4,0,0" 
											  AllowExpand="False" 
											  IsExpanded="True"
                                              x:Name="ExpPoliticas">
                        <Grid>
                            <Controls:SinacorDataGrid x:Name="DtgPoliticaCorretagem"
                                                      AllowPanelInsert="True"
                                                      AllowPanelUpdate="True"
                                                      AllowDelete="True"
                                                      InsertBegun="DtgPoliticaCorretagem_InsertBegun"
                                                      EndingInsert="DtgPoliticaCorretagem_EndingInsert"
                                                      CancelingInsert="DtgPoliticaCorretagem_CancelingInsert"
                                                      BeingUpdated="DtgPoliticaCorretagem_BeingUpdated"
                                                      UpdateBegun="DtgPoliticaCorretagem_UpdateBegun"
                                                      EndingUpdate="DtgPoliticaCorretagem_EndingUpdate"
                                                      CancelingUpdate="DtgPoliticaCorretagem_CancelingUpdate"
                                                      Deleting="DtgPoliticaCorretagem_Deleting"
                                                      CurrentCellChanged="DtgPoliticaCorretagem_CurrentCellChanged"
                                                      HorizontalAlignment="Stretch" 		
                      		                          VerticalAlignment="Stretch" 		
                                      	              RowEditMode="EditPanel"	
                                        	          Margin="0,0,0,0"
                                                      IsSynchronizedWithCurrentItem="True"
                                                      ItemsSource="{Binding ListaPoliticasCorretagem}"
                                                      PanelInsertTemplate="{Binding PanelUpdateTemplate, RelativeSource={RelativeSource Self}}">
                                <Controls:SinacorDataGrid.ContextMenuTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <Controls:SinacorContextMenuItem x:Name="MenuDuplicarPoliticaCorretagem" Header="{DynamicResource Bovespa.Corretagem.Label.Duplicar}" Loaded="MenuDuplicarPoliticaCorretagem_Loaded" Click="MenuDuplicarPoliticaCorretagem_Click" />
                                            <Controls:SinacorContextMenuItem x:Name="menuConsultarTabela" Header="{DynamicResource Bovespa.Corretagem.Label.ConsultarTabelasRelacionadas}" Loaded="menuConsultarTabela_Loaded"  Click="menuConsultarTabela_Click" />
                                        </StackPanel>
                                    </DataTemplate>
                                </Controls:SinacorDataGrid.ContextMenuTemplate>
                                <Controls:SinacorDataGrid.PanelUpdateTemplate>
                                    <DataTemplate>
                                        <Controls:SinacorExpanderContainer HorizontalAlignment="Left"
                                            VerticalAlignment="Stretch" Width="900" >
                                            <Controls:SinacorExpanderContainer.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="30" />
                                            </Controls:SinacorExpanderContainer.RowDefinitions>

                                            <!-- INÍCIO DO GRID SUPERIOR -->
                                            <Grid Grid.Row="0">
                                                <Controls:SinacorLabel x:Name="LblCodigoPolitica"
                                                                       HorizontalAlignment="Left" 
															           VerticalAlignment="Top" 
															           Content="{DynamicResource Bovespa.Corretagem.Label.CodigoPolitica}" 
															           Width="112"/>
                                                <Controls:SinacorInt16TextBox x:Name="TxtCodigoPolitica"
                                                                              HorizontalAlignment="Left" 
																	          VerticalAlignment="Top" 
																	          TextWrapping="NoWrap" 
																	          Margin="116,0,0,0" 
																	          Width="60" 
																	          TabIndex="10" 
																	          Integers="4"
																	          IsFormated="False"
                                                                              IsEnabled="False"
                                                                              Value="{Binding Path=Codigo}"/>
                                                <Controls:SinacorLabel x:Name="LblDescricao"
                                                                       HorizontalAlignment="Left" 
															           Content="{DynamicResource Bovespa.Corretagem.Label.Descricao}" 
															           Margin="180,0,0,0" 
															           Width="80"/>
                                                <Controls:SinacorTextBox x:Name="TxtDescricao"
                                                                         HorizontalAlignment="Left" 
																         VerticalAlignment="Top" 
																         TextWrapping="NoWrap" 
																         Margin="260,0,0,0" 
																         Width="230" 
																         TabIndex="11"
                                                                         MaxLength="20"
                                                                         IsRequired="True"
                                                                         RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.DescricaoObrigatoria"
                                                                         Text="{Binding Path=Descricao}"/>
                                                <Controls:SinacorLabel x:Name="LblDataInicial"
                                                                       Margin="495,0,0,0" 
															           VerticalAlignment="Top" 
															           Content="{DynamicResource Bovespa.Corretagem.Label.DataInicial}" 
															           Width="92" 
															           HorizontalAlignment="Left"/>
                                                <Controls:SinacorDatePicker x:Name="DtpDataInicial"
                                                                            VerticalAlignment="Top" 
																	        Margin="591,0,0,0" 
																	        HorizontalAlignment="Left" 
																	        TabIndex="12"
                                                                            IsRequired="True"
                                                                            RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.DataInicialObrigatorio"
                                                                            />
                                                <Controls:SinacorLabel x:Name="LblDataFinal"
                                                                       Content="{DynamicResource Bovespa.Corretagem.Label.DataFinal}" 
															           Margin="700,0,0,0" 
															           Width="80" 
															           HorizontalAlignment="Left"/>
                                                <Controls:SinacorDatePicker x:Name="DtpDataFinal"
                                                                            VerticalAlignment="Top" 
																	        Margin="784,0,0,0" 
																	        HorizontalAlignment="Left" 
																	        TabIndex="13"
                                                                            IsRequired="True"
                                                                            RequiredErrorMessage="Bovespa.Corretagem.ExceptionMessage.DataFinalObrigatoria"
                                                                            />
                                                <Controls:SinacorLabel x:Name="LblAplicacao"
                                                                       HorizontalAlignment="Left" 
															           Margin="0,25,0,0" 
															           VerticalAlignment="Top" 
															           Content="{DynamicResource Bovespa.Corretagem.Label.Aplicacao}" 
															           Width="112"/>
                                                <Controls:SinacorComboBox x:Name="CmbAplicacao"
                                                                          HorizontalAlignment="Left" 
																          VerticalAlignment="Top" 
																          Margin="116,25,0,0" 
																          Width="200" 
																          TabIndex="14"
                                                                          ItemsSource="{Binding Path=Presenter.ListaTiposAplicacoesPoliticas, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                          DisplayMemberPath="Descricao"
                                                                          SelectedValuePath="Codigo"
                                                                          SelectedItem="{Binding Path=TipoAplicacao}"/>
                                                <Controls:SinacorLabel x:Name="LblTabelaPadrao"
                                                                       HorizontalAlignment="Left" 
															           Content="{DynamicResource Bovespa.Corretagem.Label.TabelaPadrao}" 
															           Margin="320,25,0,0" 
															           Width="110"/>
                                                <Controls:SinacorComboBox x:Name="CmbTabelaPadrao"
                                                                          HorizontalAlignment="Left" 
																          VerticalAlignment="Top" 
																          Margin="432,25,0,0" 
																          Width="263" 
																          TabIndex="15"
                                                                          ItemsSource="{Binding Path=Presenter.ListaComboTabelasCorretagem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                          DisplayMemberPath="Descricao"
                                                                          SelectedValuePath="Codigo"
                                                                          SelectedItem="{Binding Path=TabelaPadrao}"/>
                                                <Controls:SinacorGroupBox x:Name="GrpControleBeneficios"
                                                                          HorizontalAlignment="Left" 
																          VerticalAlignment="Top" 
																          Header="{DynamicResource Bovespa.Corretagem.Label.ControleBeneficios}" 
																          Margin="0,50,0,0" 
																          Width="430" 
																          Height="50">
                                                    <Grid>
                                                        <Controls:SinacorRadioButton x:Name="RdbNaoSelecionado"
                                                                                     HorizontalAlignment="Left" 
																			         VerticalAlignment="Top" 
																			         Content="{DynamicResource Bovespa.Corretagem.Label.Nao}" 
																			         Width="60" 
																			         IsChecked="True" 
																			         GroupName="controle" 
																			         TabIndex="16"
                                                                                     Click="RdbNaoSelecionado_Click"/>
                                                        <Controls:SinacorRadioButton x:Name="RdbUmSelecionados"
                                                                                     HorizontalAlignment="Left" 
																			         VerticalAlignment="Top" 
																			         Content="{DynamicResource Bovespa.Corretagem.Label.UmSelecionados}" 
																			         Margin="64,0,0,0" 
																			         Width="165" 
																			         GroupName="controle" 
																			         TabIndex="17"
                                                                                     Click="RdbUmSelecionados_Click"/>
                                                        <Controls:SinacorRadioButton x:Name="RdbTodosSelecionados"
                                                                                     HorizontalAlignment="Left" 
																			         VerticalAlignment="Top" 
																			         Content="{DynamicResource Bovespa.Corretagem.Label.TodosSelecionados}" 
																			         Width="175" 
																			         Margin="233,0,0,0" 
																			         GroupName="controle" 
																			         TabIndex="18"
                                                                                     Click="RdbTodosSelecionados_Click"/>
                                                    </Grid>
                                                </Controls:SinacorGroupBox>
                                                <Controls:SinacorGroupBox x:Name="GrpVerificacoes"
                                                                          HorizontalAlignment="Left" 
																          VerticalAlignment="Top" 
																          Header="{DynamicResource Bovespa.Corretagem.Label.Verificacoes}" 
																          Margin="434,50,0,0" 
																          Width="170" 
																          Height="50">
                                                    <Grid>
                                                        <Controls:SinacorRadioButton x:Name="RdbNaoPoliticaCorretagem"
                                                                                     HorizontalAlignment="Left" 
																			         VerticalAlignment="Top" 
																			         Content="{DynamicResource Bovespa.Corretagem.Label.Nao}" 
																			         Width="60" 
																			         IsChecked="True" 
																			         GroupName="verifica" 
																			         TabIndex="19"
                                                                                     Checked="RdbNaoPoliticaCorretagem_Checked"/>
                                                        <Controls:SinacorRadioButton x:Name="RdbSimPoliticaCorretagem"
                                                                                     HorizontalAlignment="Left" 
																			         VerticalAlignment="Top" 
																			         Content="{DynamicResource Bovespa.Corretagem.Label.Sim}" 
																			         Margin="94,0,0,0" 
																			         Width="60" 
																			         GroupName="verifica" 
																			         TabIndex="20"
                                                                                     Checked="RdbSimPoliticaCorretagem_Checked"/>
                                                    </Grid>
                                                </Controls:SinacorGroupBox>
                                            </Grid>
                                            <!--FIM GRID SUPERIOR -->

                                            <!--INICIO GRID DO MEIO -->
                                            <Grid Grid.Row="1" Margin="0,4,0,0" x:Name="GrdOpcoes" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="1" >
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto" />
                                                    <ColumnDefinition Width="Auto" />
                                                </Grid.ColumnDefinitions>

                                                <!--INICIO COLUNA 0 -->

                                                <Controls:SinacorExpander x:Name="ExpControledeBeneficios" 
                                                                          HorizontalAlignment="Left" 
														                  VerticalAlignment="Stretch" 
														                  Header="{DynamicResource Bovespa.Corretagem.Label.ControledeBeneficios}" 
														                  Margin="0,4,0,0"
                                                                          Height="285"
                                                                          AllowExpand="False"
														                  IsExpanded="True"
                                                                          Visibility="Hidden"
                                                                          >
                                                    <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Name="GrdBeneficio">
                                                        <Controls:SinacorLabel x:Name="LblTabelaBeneficios"
                                                                           HorizontalAlignment="Left" 
															               Content="{DynamicResource Bovespa.Corretagem.Label.TabelaBeneficios}" 
															               Width="140"/>
                                                        <Controls:SinacorComboBox x:Name="CmbTabelaBeneficios"
                                                                              HorizontalAlignment="Left" 
																              VerticalAlignment="Top" 
																              Margin="144,0,0,0" 
																              Width="250" 
																              TabIndex="21"
                                                                              ItemsSource="{Binding Path=Presenter.ListaComboTabelasCorretagem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              DisplayMemberPath="Descricao"
                                                                              SelectedValuePath="Codigo"
                                                                              SelectedItem="{Binding Path=TabelaBeneficio}"/>

                                                        <Controls:SinacorDataGrid x:Name="DtgTabelaBeneficios"
                                                                              HorizontalAlignment="Stretch" 		
								    							              VerticalAlignment="Stretch" 		
								    							              IsSynchronizedWithCurrentItem="True" 							 		
								    							              IsEnabled="False"
                                                                              AllowDelete="False"
                                                                              AllowSave="False"
                                                                              AllowSaveAll="False"
                                                                              UpdateBegun="DtgTabelaBeneficios_UpdateBegun"
                                                                              CancelingUpdate="DtgTabelaBeneficios_CancelingUpdate"
                                                                              EndingUpdate="DtgTabelaBeneficios_EndingUpdate"
                                                                              CurrentCellChanged="DtgTabelaBeneficios_CurrentCellChanged"
                                                                              Width="Auto"
								    							              RowEditMode="AllCells"		
								    							              Margin="0,25,0,0"
                                                                              NewItemType="{x:Type Model:ControleBeneficio}"
                                                                              ItemsSource="{Binding Path=Beneficios}">
                                                            <Controls:SinacorDataGrid.Columns>
                                                                <Controls:Column Name="Selecao"
			    												             Title="Bovespa.Corretagem.Label.Selecao"
                                                                             DisplayMemberPath="Utiliza"
                                                                             AllowInsert="False"
                                                                             AllowUpdate="True">
                                                                    <Controls:Column.CellUpdateTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorCheckBox x:Name="ChkSelecao" IsChecked="{Binding Utiliza}" Click="ChkSelecao_Click" />
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellUpdateTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="Tipo"
			    												             Title="Bovespa.Corretagem.Label.Tipo"
                                                                             DisplayMemberPath="TipoBeneficio.Descricao"
                                                                             AllowInsert="False"
                                                                             AllowUpdate="False"/>

                                                                <Controls:Column Name="ValorQtde"
			    												             Title="Bovespa.Corretagem.Label.ValorQtde"
                                                                             HorizontalCellAlignment="Right"
                                                                             AllowInsert="False"
                                                                             AllowUpdate="True"
                                                                             DisplayMemberPath="ValorQuantidade">
                                                                    <Controls:Column.CellUpdateTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorDecimalTextBox x:Name="TxtValorQtde" IsRequired="False" RequiredErrorMessage="Bovespa.Corretagem.Message.InformarQuantidadeValor" Integers="16" Decimals="2" Value="{Binding ValorQuantidade}" />
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellUpdateTemplate>
                                                                </Controls:Column>

                                                            </Controls:SinacorDataGrid.Columns>
                                                        </Controls:SinacorDataGrid>

                                                    </Grid>
                                                </Controls:SinacorExpander>
                                                <!--FIM COLUNA 0 -->

                                                <!--INICIO COLUNA 1 -->
                                                <Controls:SinacorExpander x:Name="ExpVerificacoes" 
                                                                          HorizontalAlignment="Stretch" 
														                  VerticalAlignment="Stretch" 
														                  Header="{DynamicResource Bovespa.Corretagem.Label.Verificacoes}" 
														                  Margin="0,4,0,0"
                                                                          Height="285"
                                                                          AllowExpand="False"
														                  IsExpanded="True" 
                                                                          Visibility="Hidden"
                                                                           >
                                                    <Grid Name="GrdVerificacoes" HorizontalAlignment="Left" VerticalAlignment="Top">

                                                        <Controls:SinacorDataGrid x:Name="DtgVerificacoes"
                                                                                      HorizontalAlignment="Stretch" 		
								    							                      VerticalAlignment="Stretch" 		
								    							                      IsSynchronizedWithCurrentItem="True"
                                                                                      AllowDelete="True"
                                                                                      AllowSave="False"
                                                                                      AllowSaveAll="False"
                                                                                      IsEnabled="False"
                                                                                      InsertBegun="DtgVerificacoes_InsertBegun"
                                                                                      CancelingInsert="DtgVerificacoes_CancelingInsert"
                                                                                      EndingInsert="DtgVerificacoes_EndingInsert"
                                                                                      Deleting="DtgVerificacoes_Deleting" 
                                                                                      CurrentCellChanged="DtgVerificacoes_CurrentCellChanged"
                                                                                      NewItemType="{x:Type Model:VerificacaoPolitica}"
                                                                                      ItemsSource="{Binding Path=Verificacoes}"
                                                                                      Margin="0,0,0,0">
                                                            <Controls:SinacorDataGrid.Columns>
                                                                <Controls:Column Name="Operador"
			    												             Title="Bovespa.Corretagem.Label.Operador"
                                                                             HorizontalCellAlignment="Right"
                                                                             DisplayMemberPath="CodigoOperador"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False">
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorInt32TextBox x:Name="TxtOperador" IsRequired="True" RequiredErrorMessage="Bovespa.Corretagem.Message.InformeOperador" Integers="6" IsFormated="False" Value="{Binding CodigoOperador}">
                                                                                <Controls:SinacorInt32TextBox.ValidationRules>
                                                                                    <Validation:EventValidationRule Validating="txtOperador_Validating"/>
                                                                                </Controls:SinacorInt32TextBox.ValidationRules>
                                                                            </Controls:SinacorInt32TextBox>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="Assessor"
			    											                 Title="Bovespa.Corretagem.Label.Assessor"
                                                                             HorizontalCellAlignment="Right"
                                                                             DisplayMemberPath="CodigoAssessor"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False">
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorInt32TextBox x:Name="TxtAssessor" Integers="5" IsFormated="False" Value="{Binding CodigoAssessor}">
                                                                                <Controls:SinacorInt32TextBox.ValidationRules>
                                                                                    <Validation:EventValidationRule Validating="txtAssessor_Validating"/>
                                                                                </Controls:SinacorInt32TextBox.ValidationRules>
                                                                            </Controls:SinacorInt32TextBox>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="Agente"
			    												             Title="Bovespa.Corretagem.Label.Agente"
                                                                             HorizontalCellAlignment="Right"
                                                                             DisplayMemberPath="CodigoAgente"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False">
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorInt32TextBox x:Name="TxtAgente" Integers="5" IsFormated="False" Value="{Binding CodigoAgente}">
                                                                                <Controls:SinacorInt32TextBox.ValidationRules>
                                                                                    <Validation:EventValidationRule Validating="txtAgente_Validating"/>
                                                                                </Controls:SinacorInt32TextBox.ValidationRules>
                                                                            </Controls:SinacorInt32TextBox>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="Mercado"
			    												             Title="Bovespa.Corretagem.Label.Mercado"
                                                                             DisplayMemberPath="Mercado"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False"
                                                                             >
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorComboBox x:Name="CmbMercado"
                                                                                                  ItemsSource="{Binding Path=Presenter.ListaMercados, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                                                  SelectedValue="{Binding Path=Mercado}"/>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="Carteira"
			    												             Title="Bovespa.Corretagem.Label.Carteira"
                                                                             HorizontalCellAlignment="Right"
                                                                             DisplayMemberPath="Carteira"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False">
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorInt32TextBox x:Name="TxtCarteira" Integers="3" IsFormated="False" Value="{Binding Carteira}" />
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="NatOper"
			    												             Title="Bovespa.Corretagem.Label.NaturezaOperacao"
                                                                             HorizontalCellAlignment="Right"
                                                                             DisplayMemberPath="NaturezaOperacao"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False">
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorComboBox x:Name="CmbNatOper"
                                                                                                  ItemsSource="{Binding Path=Presenter.NaturezaOperacao, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                                                  SelectedValue="{Binding Path=NaturezaOperacao}"/>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="Ativo"
			    												             Title="Bovespa.Corretagem.Label.Ativo"
                                                                             DisplayMemberPath="Ativo"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False">
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorTextBox x:Name="TxtAtivo" MaxLength="12" Text="{Binding Ativo}">
                                                                                <Controls:SinacorTextBox.ValidationRules>
                                                                                    <Validation:EventValidationRule Validating="txtAtivo_Validating"/>
                                                                                </Controls:SinacorTextBox.ValidationRules>
                                                                            </Controls:SinacorTextBox>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="Tabela"
			    												             Title="Bovespa.Corretagem.Label.Tabelas"
                                                                             DisplayMemberPath="TabelaPadrao.Descricao"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False">
                                                                    <Controls:Column.CellTemplate>
                                                                        <DataTemplate>
                                                                            <StackPanel>
                                                                                <Controls:SinacorLabel x:Name="LblTabela" Content="{Binding ElementName=CmbTabela_Aux, Path=Text}" />
                                                                                <Controls:SinacorComboBox x:Name="CmbTabela_Aux"
                                                                                  ItemsSource="{Binding Path=Presenter.ListaComboTabelasCorretagem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                                  DisplayMemberPath="Descricao"
                                                                                  SelectedValuePath="Codigo"
                                                                                  SelectedValue="{Binding Path=CodigoTabelaPadrao}"
                                                                                  Visibility="Hidden"/>
                                                                            </StackPanel>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellTemplate>
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorComboBox x:Name="CmbTabela"
                                                                              ItemsSource="{Binding Path=Presenter.ListaComboTabelasCorretagem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              DisplayMemberPath="Descricao"
                                                                              SelectedValuePath="Codigo"
                                                                              SelectedValue="{Binding Path=CodigoTabelaPadrao}"
                                                                              WidthPopup="150"/>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                                <Controls:Column Name="TabBenef"
			    												             Title="Bovespa.Corretagem.Label.TabelaBeneficios"
                                                                             DisplayMemberPath="TabelaBeneficio.Descricao"
                                                                             AllowInsert="True"
                                                                             AllowUpdate="False">
                                                                    <Controls:Column.CellTemplate>
                                                                        <DataTemplate>
                                                                            <StackPanel>
                                                                                <Controls:SinacorLabel x:Name="LblTabBenef" Content="{Binding ElementName=CmbTabBenef_Aux, Path=Text}" />
                                                                                <Controls:SinacorComboBox x:Name="CmbTabBenef_Aux"
                                                                                  ItemsSource="{Binding Path=Presenter.ListaComboTabelasCorretagem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                                  DisplayMemberPath="Descricao"
                                                                                  SelectedValuePath="Codigo"
                                                                                  SelectedValue="{Binding Path=CodigoTabelaBeneficio}"
                                                                                  Visibility="Hidden"/>
                                                                            </StackPanel>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellTemplate>
                                                                    <Controls:Column.CellInsertTemplate>
                                                                        <DataTemplate>
                                                                            <Controls:SinacorComboBox x:Name="CmbTabBenef"
                                                                              ItemsSource="{Binding Path=Presenter.ListaComboTabelasCorretagem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}}"
                                                                              DisplayMemberPath="Descricao"
                                                                              SelectedValuePath="Codigo"
                                                                              SelectedValue="{Binding Path=CodigoTabelaBeneficio}"/>
                                                                        </DataTemplate>
                                                                    </Controls:Column.CellInsertTemplate>
                                                                </Controls:Column>

                                                            </Controls:SinacorDataGrid.Columns>
                                                        </Controls:SinacorDataGrid>

                                                    </Grid>
                                                </Controls:SinacorExpander>
                                                <!--FIM COLUNA 1 -->

                                            </Grid>
                                            <!--FINAL GRID MEIO -->

                                            <!--INICIO GRID BOTOES -->
                                            <Grid Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top">
                                                <Controls:SinacorButton x:Name="BtnSalvarPoliticaCorretagem" HorizontalAlignment="Left" 
															            VerticalAlignment="Top" 
															            Content="{DynamicResource Bovespa.Corretagem.Label.Salvar}" 
															            Margin="711,0,0,0" 
															            Width="90" 
															            TabIndex="21" 
                                                                        Click="BtnSalvarPoliticaCorretagem_Click"
                                                                        CausesValidation="True"/>
                                                <Controls:SinacorButton x:Name="btnCancelarPoliticaCorretagem"
                                                                        HorizontalAlignment="Left"
                                                                        VerticalAlignment="Top" 
                                                                        Margin="805,0,0,0" 
															            Content="{DynamicResource Bovespa.Corretagem.Label.Cancelar}" 
															            Width="85" 
															            TabIndex="22"
                                                                        Click="BtnCancelarPoliticaCorretagem_Click"
                                                                        CausesValidation="False"/>
                                            </Grid>
                                        </Controls:SinacorExpanderContainer>
                                    </DataTemplate>
                                </Controls:SinacorDataGrid.PanelUpdateTemplate>
                                <Controls:SinacorDataGrid.Columns>

                                    <Controls:Column Name="CodPolitica"
                                                     Title="Bovespa.Corretagem.Label.CodigoPolitica"
                                                     HorizontalCellAlignment="Right"
                                                     DisplayMemberPath="Codigo"/>

                                    <Controls:Column Name="Descricao"
                                                     Title="Bovespa.Corretagem.Label.Descricao"
                                                     DisplayMemberPath="Descricao"/>

                                    <Controls:Column Name="DataInicial"
                                                     Title="Bovespa.Corretagem.Label.DataInicial"
                                                     DisplayMemberPath="DataInicial"
                                                     HorizontalCellAlignment="Center"/>

                                    <Controls:Column Name="DataFinal"
                                                     Title="Bovespa.Corretagem.Label.DataFinal"
                                                     DisplayMemberPath="DataFinal"
                                                     HorizontalCellAlignment="Center"/>

                                    <Controls:Column Name="TipoAplicacao"
                                                     Title="Bovespa.Corretagem.Label.TipoAplicacao"
                                                     DisplayMemberPath="TipoAplicacao.Descricao"/>

                                    <Controls:Column Name="TabelaPadrao"
                                                     Title="Bovespa.Corretagem.Label.TabelaPadrao"
                                                     DisplayMemberPath="TabelaPadrao.Descricao"/>

                                </Controls:SinacorDataGrid.Columns>
                            </Controls:SinacorDataGrid>

                        </Grid>
                    </Controls:SinacorExpander>
                </Controls:SinacorExpanderContainer>
            </Grid>

        </Controls:SinacorTabItem>
    </Controls:SinacorTabControl>
</Controls:SinacorWindow>
